package com.situ.water_system.controller;


import com.situ.water_system.pojo.SyEmpmenupower;
import com.situ.water_system.pojo.SyMenu;
import com.situ.water_system.service.SyEmpmenupowerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author Angel
 * @since 2020-12-01
 */
@RestController
@RequestMapping("/Syempmenupower")
public class SyEmpmenupowerController {
    @Autowired
    private SyEmpmenupowerService service;

    @RequestMapping("/querybyid/{id}")
    public List<SyEmpmenupower> showid(@PathVariable(name = "id") int id) {
        return service.showid(id);
    }

    @RequestMapping("/del")
    public int del(Integer[] empid) {
                service.delmenu(empid);
                return 1;
    }

    @RequestMapping("/add")
    public int add(Integer[] empid, Integer[] menuid) {
        System.out.println(menuid.length);
        return service.addmenu(empid, menuid);
    }
}

